package com.zhanggm.springcloud.jpa.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author zhanggm
 * null
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "tb_depart")
@DynamicInsert
@DynamicUpdate
public class TbDepart implements Serializable {

	/**
	 * null
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Integer id;

	/**
	 * null
	 */
	@Column(name = "name")
	private String name;

	/*@JsonIgnoreProperties("tbDepart")
	@OneToMany(mappedBy = "departId")
	private List<TbDoctor> doctors;*/

	@OneToMany
	@JoinColumn(name = "depart_id")
	private List<TbDoctor> doctors;


}
